import { useRoutes } from 'react-router-dom'
import Home from '../views/Home/Home'
import Layout from '../views/Layout/Layout'
import FormInfo from '../components/FormInfo'
import Step2 from '../components/Step2'

import AddDetail from '../views/AddDetail/AddDetail'

function RouterView() {
  const routes = useRoutes([
    // 路由信息表
    {
      path: '/home',
      element: <Home />,
      children:[
        {
          index:true,
          element:<FormInfo/>
        },
        {
          path:'/home/step2',
          element:<Step2/>
        }
      ]
    },  
    {
      path:'/',
      element:<Layout/>
    },
    {
      path: '/add/detail',
      element: <AddDetail />
    }
  ])
  return routes
}
export default RouterView